package com.jcnet.bizaia.adapter;

import java.util.List;

import com.androidquery.AQuery;
import com.androidquery.callback.ImageOptions;
import com.jcnet.bizaia.App;
import com.jcnet.bizaia.R;
import com.jcnet.bizaia.bean.MainInfoBean;
import com.jcnet.bizaia.bean.VoiceDetailBean;
import com.squareup.picasso.Picasso;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

public class MainVoiceDeatalAdapter extends BaseAdapter {

	private Context context;
	private List<VoiceDetailBean> infoBeans;
	public int count;
	
	
	
	
	public MainVoiceDeatalAdapter(Context context, List<VoiceDetailBean> infoBeans) {
		super();
		this.context = context;
		this.infoBeans = infoBeans;
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		count = infoBeans.size();
		return count;
	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		// TODO Auto-generated method stub
		ViewHolder holder;
        if(convertView == null)
        {
            holder = new ViewHolder();
            convertView = View.inflate(context,R.layout.expandable_list_item, null);
            holder.titleTextView = (TextView)convertView.findViewById(R.id.listText);
            
            convertView.setTag(holder);
        }else
        {
            holder = (ViewHolder)convertView.getTag();
            
        }
        
        VoiceDetailBean infoBean  =   infoBeans.get(position);
        if(infoBean!=null){
        	
        	holder.titleTextView.setText(infoBean.getCsname());
        	
        }
		return convertView;
	}

	static class ViewHolder{
		TextView titleTextView;
	}
}
